import request from '@/utils/request'

const URL = '/apartment/check-in'

// 获取列表
export function list(params) {
  return request({
    url: URL + '/list',
    method: 'get',
    params: params
  })
}

// 新增入住信息
export function save(data) {
  return request({
    url: URL,
    method: 'post',
    data: data
  })
}

// 编辑
export function update(data) {
  return request({
    url: URL,
    method: 'put',
    data: data
  })
}

// 获取入住信息
export function getInfo(checkInId) {
  return request({
    url: URL + `/${checkInId}`,
    method: 'get'
  })
}

// 退房
export function out(checkInId) {
  return request({
    url: URL + `/out/${checkInId}`,
    method: 'put'
  })
}


// 删除
export function remove(checkInIds) {
  return request({
    url: URL + `/${checkInIds}`,
    method: 'delete'
  })
}
export default {
  save,
  update,
  getInfo,
  out,
  remove,
  list
}